/**
 * 
 */
package com.df.tv.launcher.model;

import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.text.TextUtils;

/**
 * @author lcw 2014-6-5 上午10:18:07
 */
public class AppMgrMod {
    /**
     * Check the packageName is exist or not
     * 
     * @param ctx
     * @param pName
     * @return
     */
    public PackageInfo checkAppExist(Context ctx, String pName) {
        PackageInfo rslt = null;

        if (!TextUtils.isEmpty(pName)) {
            PackageManager pm = ctx.getPackageManager();
            try {
                rslt = pm.getPackageInfo(pName, 0);
            } catch (NameNotFoundException e) {
                e.printStackTrace();
            }
        }
        return rslt;

    }
}
